package org.ntu.csn.doraemon.canvas;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;


public class DescForm implements CommandListener {


	public Form descForm = new Form("Game Rule");	
	
	private StartMenu sm ;	
	
	public DescForm(StartMenu sm) {
		this.sm = sm;
		addForm();
	}

	public void addForm() {		
		descForm.append("Game Description");     
		StringItem item = new StringItem("The role in the game: ", "Doraemon");
		descForm.append(item);
		item = new StringItem("Participator: ", "Doraemon");
		descForm.append(item);
		item = new StringItem("Rule: ", "\n" +"1. Control Doraemon's movement using navigation keys" +
				"\n" + "2. Take dorayaki as many as possible" +
				"\n" + "3. Collect a certain number of dorayaki to activate next level or win the game."+
				"\n" + "6. All the bomb can kill the Doraemon a life" +
				"\n" + "7. The poison will slown down the running speed of Doraemon if accidently taken it"+
				"\n" + "8. All enhancer can be taken to speed doraemon up."+
				"\n" + "9. Total 3 game levels"
);
		descForm.append(item);
		descForm.addCommand(Listener.back);
		descForm.setCommandListener(this);
	}

	public void commandAction(Command c, Displayable d) {
		if ( c == Listener.back) {
			 Display.getDisplay(sm).setCurrent(StartMenu.mainMenu);
        } else if ( c == Listener.ok) {
       	 //load the game
        }
	}

	public Form getdescForm() {
		return descForm;
	}

	public void setdescForm(Form descForm) {
		this.descForm = descForm;
	}

	
	
	
}
